package leetcode;

import java.util.Arrays;

/**
 * @创建人 mby381
 * @创建时间 2022/3/23
 * @描述
 */
public class Solution0344 {
    public static void reverseString(char[] s) {
        int length = s.length;
        int left = 0;
        int right = length - 1;
        char temp;
        while (left < right) {
            temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }
        return;
    }

    public static void main(String[] args) {
        char[] s = new char[]{'h', 'l', 'l', 'e', 'o'};
        reverseString(s);
        System.out.println(Arrays.toString(s));
    }
}
